#ifndef __DEBUG__
// For printing purposes
#define __DEBUG__ 0
#endif

#include <iostream>
#include <cstdint>

#include "../VAR.hpp"
#include "../TERM.hpp"
#include "../EXPRESSION.hpp"
#include "../ADD.hpp"
#include "../SUB.hpp"
#include "../MIN.hpp"
#include "../MAX.hpp"
#include "../CEIL.hpp"
#include "../FLOOR.hpp"
#include "../GE.hpp"
#include "../FOR.hpp"

using namespace std;

// Global variables for printing and debugging purposes
int expr_depth = -1;
int bin_expr_depth = -1;

void testa() {

  constexpr VariableTerm<1> t1;
  constexpr VariableTerm<2> t2;
  constexpr VariableTerm<3> t3;
  constexpr VariableTerm<4> t4;
  constexpr VariableTerm<5> t5;
  constexpr VariableTerm<6> pN;
  constexpr VariableTerm<7> pT;
  
  constexpr std::tuple<int, int, int, int, int, int, int, int> 
    test_tuple_min(0, 1, 2, 3, 4, 5, 256, 2048);
  constexpr std::tuple<int, int, int, int, int, int, int, int> 
    test_tuple_max(0, 10, 20, 30, 40, 50, 256, 2048);
  
  static constexpr auto p1 = 
    FOR(t1, CEIL(-pN-15,16), FLOOR(pT-3,16));

  static constexpr auto lb = p1.first;
  static constexpr auto ub = p1.second;
  static_assert(lb.Val(test_tuple_min) == -16, "SHOULD BE -16 !!!");
  static_assert(ub.Val(test_tuple_min) == 127, "SHOULD BE 127 !!!");
}

int main (void) {
  testa();
}
